<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>std.stdarg</title>
  <link href="html.css" rel="stylesheet" type="text/css">
</head>
<body>
<table><tr>
<td class="linescolumn"><a id="L1" href="#L1">1</a><a id="L2" href="#L2">2</a><a id="L3" href="#L3">3</a><a id="L4" href="#L4">4</a><a id="L5" href="#L5">5</a><a id="L6" href="#L6">6</a><a id="L7" href="#L7">7</a><a id="L8" href="#L8">8</a><a id="L9" href="#L9">9</a><a id="L10" href="#L10">10</a><a id="L11" href="#L11">11</a><a id="L12" href="#L12">12</a><a id="L13" href="#L13">13</a><a id="L14" href="#L14">14</a><a id="L15" href="#L15">15</a><a id="L16" href="#L16">16</a><a id="L17" href="#L17">17</a><a id="L18" href="#L18">18</a><a id="L19" href="#L19">19</a><a id="L20" href="#L20">20</a><a id="L21" href="#L21">21</a><a id="L22" href="#L22">22</a><a id="L23" href="#L23">23</a></td>
<td><td><pre class="sourcecode">

<span class="bc">/*
 * Placed in public domain.
 * Written by Hauke Duden and Walter Bright
 */</span>

<span class="bc">/* This is for use with variable argument lists with extern(D) linkage. */</span>

<span class="d Compound"><span class="d Module"><span class="k">module</span> <span class="i">std</span>.<span class="i">stdarg</span>;</span>

<span class="d Alias"><span class="k">alias</span> <span class="d Variables"><span class="t Integral"><span class="k">void</span></span><span class="t Pointer">*</span> <span class="i">va_list</span>;</span></span>

<span class="d Template"><span class="k">template</span> <span class="i">va_arg</span><span class="o TemplateParameters">(<span class="o TemplateTypeParameter"><span class="i">T</span></span>)</span>
<span class="d Compound">{
    <span class="d Function"><span class="t Identifier"><span class="i">T</span></span> <span class="i">va_arg</span><span class="o Parameters">(<span class="o Parameter"><span class="k">inout</span> <span class="t Identifier"><span class="i">va_list</span></span> <span class="i">_argptr</span></span>)</span>
    <span class="s FuncBody"><span class="s Compound">{
	<span class="s Declaration"><span class="d Variables"><span class="t Identifier"><span class="i">T</span></span> <span class="i">arg</span> = <span class="e Deref">*<span class="e Cast"><span class="k">cast</span>(<span class="t Identifier"><span class="i">T</span></span><span class="t Pointer">*</span>)<span class="e Identifier"><span class="i">_argptr</span></span></span></span>;</span></span>
	<span class="s Expression"><span class="e Assign"><span class="e Identifier"><span class="i">_argptr</span></span> = <span class="e Plus"><span class="e Identifier"><span class="i">_argptr</span></span> + <span class="e Paren">(<span class="e And"><span class="e Paren">(<span class="e Minus"><span class="e Plus"><span class="e Dot"><span class="e Identifier"><span class="i">T</span></span>.<span class="e Identifier"><span class="i">sizeof</span></span></span> + <span class="e TypeDotId"><span class="t Integral"><span class="k">int</span></span>.<span class="i">sizeof</span></span></span> - <span class="e Int"><span class="n">1</span></span></span>)</span> &amp; <span class="e Comp">~<span class="e Paren">(<span class="e Minus"><span class="e TypeDotId"><span class="t Integral"><span class="k">int</span></span>.<span class="i">sizeof</span></span> - <span class="e Int"><span class="n">1</span></span></span>)</span></span></span>)</span></span></span>;</span>
	<span class="s Return"><span class="k">return</span> <span class="e Identifier"><span class="i">arg</span></span>;</span>
    }</span></span></span>
}</span></span></span>


</pre></td>
</tr></table>
</body>
</html>